Skip to content

Add games:topple, a slingshot game on klyph-physics - #78

Open
inemtsev wants to merge 4 commits into
mainfrom
topple
Open

inemtsev wants to merge 4 commits into
mainfrom
topple

Conversation

@inemtsev

Copy link
Copy Markdown
Owner

Resolves #73.

Topple, a slingshot game on klyph-physics: fling stones from a knight's sling at goblins in towers of stone and planks, across three levels. Retro pixel art, generated with Grok Imagine (36 images, $0.72; every prompt is in games/topple/assets/README.md), loaded with assets.region so it lands in the automatic atlas. Sounds and a chiptune march come from games/topple/tools/synth.py. No engine module changes.

Topple

It shows physics inside an ordinary klyph game:

  • Every block and goblin body is built with rigidBody(collider, transform) and drawn as a Sprite through PhysicsBody and Interpolated.
  • Iron bolts are welds with a breakForce, measured with joints.forceOf: a standing tower pulls them at most 36k, a hit takes them past the 430k limit.
  • The stone is a Motion.BULLET.
  • A goblin falls on a stone hit, when it tips past 70°, or when it reaches the ground below its start.
  • The camera follows drawnPositionOf(stone) and shakes through offsetX.

Verified on macosArm64:

Step Result
./gradlew check pass, detekt with no baseline
autopilot, debug, 60 s 12 goblins defeated, 3 levels cleared
autopilot, release, 20 s 4 goblins defeated, 1 level cleared
screenshots title, aiming arc, collapses, level clear, fail screen

Friction found

  • addPhysics ignores scenes; six hooks toggle physics.isPaused.
  • No rolling resistance or per-body damping: the stone rolled across the level until the game slowed it by hand.
  • No impact strength on contacts.
  • No rigidBodies.isTouchingSolids (particles have isTouching).
  • No body-to-entity lookup; a removed body's slot can be taken while an entity still follows it.
  • No massOf, so breakForce is worked out from area × density × gravity.
  • Smaller: no Canvas.drawLine, KLYPH_SCREENSHOT writes physical pixels, angleOf is not wrapped.

README.md, CLAUDE.md, CONTRIBUTING.md and settings.gradle.kts overlap with the Flipper PR; whichever merges second gets rebased.

Three levels of stone and wooden towers with goblin guards, a knight's
sling aimed with the mouse, keys or a gamepad, iron bolts that are welds
with a break force, and an autopilot for smoke runs. Generated pixel-art
sprites and synthesised sounds and march.
Slow the stone while it rolls on the ground, tint the far castle with the
haze, keep the clouds clear of the HUD, record the art prompts and the
sounds in assets/README.md, add the screenshot, and list the game in the
README, CLAUDE.md and CONTRIBUTING.md.
…line

Draw a dark band behind the title so its text reads over a cloud, log the
strongest pull on the bolts at rest and per throw with joints.forceOf
against the break force, and name the scores in the exit line: the last
finished campaign, the best, and the unfinished one.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A slingshot tower toppler sample game for klyph-physics

1 participant